window.$$test = jDev.test = {

  _element: null,
  _frame: null,
  _loaded: null,

  _path: 'import/JSSPec/demo.html',
  
  init: function() {
    $$test._element = document.getElementById('jdTest');
    $$test._frame = document.getElementById('jdTest_frame');
  },
  
  draw: function(height, width) {
    if (!$$test._loaded) {
      $$test._frame.src = jDev.baseURL + $$test._path;
      $$test._loaded = true;
      $$ui.maximize();
    }
    
    if (height) {
      $$test._element.style.height = height + 'px';
    }    
    if (width) {
      $$test._element.style.width = width + 'px';
    }    
  } 
  
  /*
  _run: function() {
  },
  
  add: function() {
  },
  
  addSuite: function() {
  },
  
  setStatus: function() {
  },
  
  setDelay: function() {
  },
  
  wait: function() {
  },
  
  ask: function() {
  },
  
  assert:             assert,
  assertTrue:         assertTrue,
  assertFalse:        assertFalse,
  assertEquals:       assertEquals,
  assertNotEquals:    assertNotEquals,
  assertNull:         assertNull,
  assertNotNull:      assertNotNull, 
  assertUndefined:    assertUndefined,
  assertNotUndefined: assertNotUndefined,
  assertNaN:          assertNaN,
  assertNotNaN:       assertNotNaN,
  fail:               fail
  /**/
  
};

/*
var $$ = function(){return {is: function(){}}};

$$(10 + 3).is(13);

$$(10 + 3, is, 13);


$$test('',{
  'teste 1': function(){
    $$().is()
    $$().isnt()
    $$().isEmpty()
    $$().isntEmpty()
    $$().has()
    $$().hasAtLeast()
    $$().hasAtMost()
    $$().hasnt()
    $$().include()
    $$().doesntInclude()
    $$().match()
    $$().doesntMatch()
    $$().fail()
  }
});
*/

TRACE = function(obj, fn){
  TRACE._oldFn = obj[fn];
  var result = null;
  
  obj[fn] = function() {
    $$console.log(fn);
    result = TRACE._oldFn();
    try{
      0();
    }catch(e){
      $$console.log('trace')
      for(ei in e) {
        $$console.log(ei + ': ' + e[ei])
      }
    }
    /**/
    return result;
    
  };
}
//TRACE($$ui, 'show')